package com.example.web.aspect;

import java.util.Date;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Component;

import com.example.web.annotation.DoneTime;

@Aspect
@Component
public class DoneTimeAspect {

	@Around("@annotation(doneTime)")
	public Object around(ProceedingJoinPoint joinPoint, DoneTime doneTime) throws Throwable {
		System.out.println("方法开始时间是:" + new Date());
		Object o = joinPoint.proceed();
		System.out.println("方法结束时间是:" + new Date());
		return o;
	}
}
